package com.amit.Basic_Simple_Program;

import java.util.Scanner;

public class SearchElement_ByInserting_ArrayElement {

	public static void main(String[] args) {
		int c;
		int array[];
		
		System.out.println("Enter the number for array element");
		
		Scanner sc=new Scanner(System.in);
		int size=sc.nextInt();
		array=new int[size];
		
		System.out.println("Enter the element of array");
		for(int i=0;i<=size-1;i++)
		{
			array[i]=sc.nextInt();
		}
		
		System.out.println("Enter the elenent for search");
		int search=sc.nextInt();
	for( c=0;c<=array.length-1;c++)
	{
		if(array[c]==search)
		{
			System.out.println(search+" "+"is present at location"+" "+c);
			break;
		}
	}
	
	if(c==array.length)
	{
		System.out.println("Element is not present");
	}

	}

}
